<?php
/**
 * Created by PhpStorm.
 * User: dell
 * Date: 2019/1/24
 * Time: 8:52
 */
require_once "../config/config.php";
require_once "../model/adminDb.php";
$adminDb=new adminDb();
$not_change=0;
$revised=1;
$page = $_POST['page'];//当前页
$limit = $_POST['limit'];//限制查询数据的数量
$firstNum = ($page - 1) * $limit;
$lastNum = $page * $limit;
$name = $_SESSION['name'];
$data=$adminDb->query_status_nr($not_change,$revised,$name);
$count=count($data);
$dataPage=$adminDb->query_status_nr_page($not_change,$revised,$name,$firstNum,$lastNum);
try {
    $result = $data;

    if ($result) {
        $dat = array(
            'code' => 0,
            'data'=>$dataPage,
            'count' => $count,
            'msg' => "查询成功",
        );
        echo json_encode($dat);
    } else {
        $dat = array(
            'code' => 404,
            'count' => 0,
            'msg' => "查询失败",
        );
        echo json_encode($dat);
    }
} catch (Exception $e) {
    echo $e->getMessage();
}

